/*
 *    Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: lengleng (wangiegie@gmail.com)
 */
import {PASS_DETAILS, PASS_GROUP, PASS_STATE, TIMESLOT_AREA, TIMESLOT_STATE, TIMESLOT_WEEK} from '@/const/Dict'

export const tableOption = {
    border: true,
    index: true,
    indexLabel: '序号',
    stripe: true,
    menuAlign: 'center',
    menuWidth: 200,
    menuType: 'button',
    align: 'center',
    emptyBtnText: '重置', //清空按钮文案
    refreshBtn: true,
    showClomnuBtn: false,
    searchSize: 'mini',
    searchMenuSpan: 6,
    addBtn: false,
    editBtn: false,
    delBtn:false,
    viewBtn: false,
    selection: true,
    excelBtn: false,
    props: {
        label: 'label',
        value: 'value'
    },
    column: [
        {
            label: 'id',
            prop: 'id',
            hide: true
        },
        {
            width: 300,
            label: '方案名称',
            prop: 'schemeName',
            type: 'input',
            search: true
        }, {
            label: '授权群体',
            prop: 'groupNum',
            type: 'select',
            search: false,
            dicData: PASS_GROUP,
            addDisplay: false,
            editDisplay: false,
            value: '2'

        }, {
            label: '子时间段',
            prop: 'childTimeCount',
            addDisplay: false,
            editDisplay: false,
        }, {
            label: '绑定人数',
            prop: 'personNum',
            addDisplay: false,
            editDisplay: false,
            dicData: PASS_DETAILS,
        }, {
            label: '生效开始时间',
            prop: 'validTimeStart',
            type: 'datetime',
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
        },
        {
            label: '生效结束时间',
            prop: 'validTimeEnd',
            type: 'datetime',
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
        }, {
            width: 150,
            label: '修改时间',
            prop: 'updateTime',
            type: 'datetime',
            format: 'yyyy-MM-dd HH:mm',
            valueFormat: 'yyyy-MM-dd HH:mm:ss',
        }, {
            label: '当前状态',
            prop: 'state',
            dicData: PASS_STATE,
            search: false,
            type: 'select',
            slot: true,
        },
    ]
}
export const tableDictItemOption = {
    border: true,
    index: true,
    indexLabel: '序号',
    stripe: true,
    menuAlign: 'center',
    menuWidth: 210,
    align: 'center',
    editBtn: false,
    addBtn: false,
    delBtn: false,
    submitBtn: true,
    selection: true,
    submitText: '提交',
    menu: false,
    columnBtn: false,
    reserveSelection: true,
    props: {
        label: 'label',
        value: 'value'
    },
    column: [
        {
            width: 220,
            label: '时间段名',
            prop: 'timeSectionName',
            type: 'input',
        }, {
            label: '通行区域属性',
            prop: 'area',
            type: 'select',
            dicData: TIMESLOT_AREA,
        }, {
            label: '生效时间',
            prop: 'week',
            dicData: TIMESLOT_WEEK,
        }, {
            label: '进向时间',
            prop: 'inTimeBuild',
            slot: true,
        }, {
            label: '出向时间',
            prop: 'outTimeBuild',
            slot: true,
        }, {
            label: '创建时间',
            prop: 'createTime',
            type: 'datetime',
            format: 'yyyy-MM-dd HH:mm',
            valueFormat: 'yyyy-MM-dd HH:mm:ss',
            addDisplay: false,
            editDisplay: false,
        }, {
            label: '时间属性',
            prop: 'state',
            dicData: TIMESLOT_STATE,
        }, {
            label: '指定开始时间',
            prop: 'scheduleTimeStart',
            search: false,
            type: "date",
            hide: true,
            pickerOptions: {
                disabledDate(time) {
                    return time.getTime() > Date.now();
                },
                shortcuts: [{
                    text: '今天',
                    onClick(picker) {
                        picker.$emit('pick', new Date());
                    }
                }]
            },
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
        }, {
            label: '指定结束时间',
            prop: 'scheduleTimeEnd',
            search: false,
            type: "date",
            hide: true,
            pickerOptions: {
                disabledDate(time) {
                    return time.getTime() > Date.now();
                },
                shortcuts: [{
                    text: '今天',
                    onClick(picker) {
                        picker.$emit('pick', new Date());
                    }
                }]
            },
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
        },

    ]
}
export const tableEditItemOption = {
    border: true,
    index: true,
    indexLabel: '序号',
    stripe: true,
    menuAlign: 'center',
    menuWidth: 210,
    align: 'center',
    editBtn: false,
    addBtn: false,
    delBtn: false,
    submitBtn: true,
    selection: true,
    columnBtn: false,
    refreshBtn: false,
    submitText: '提交',
    menu: false,
    maxHeight: 350,
    // height: 350,
    props: {
        label: 'label',
        value: 'value'
    },
    column: [
        {
            width: 220,
            label: '时间段名',
            prop: 'timeSectionName',
            type: 'input',
        }, {
            label: '通行区域属性',
            prop: 'area',
            type: 'select',
            dicData: TIMESLOT_AREA,
        }, {
            label: '生效时间',
            prop: 'week',
            dicData: TIMESLOT_WEEK,
        }, {
            label: '进向时间',
            prop: 'inTimeBuild',
            slot: true,
        }, {
            label: '出向时间',
            prop: 'outTimeBuild',
            slot: true,
        }, {
            label: '创建时间',
            prop: 'createTime',
            type: 'datetime',
            format: 'yyyy-MM-dd HH:mm',
            valueFormat: 'yyyy-MM-dd HH:mm:ss',
            addDisplay: false,
            editDisplay: false,
        }, {
            label: '时间属性',
            prop: 'state',
            dicData: TIMESLOT_STATE,
        }, {
            label: '指定开始时间',
            prop: 'scheduleTimeStart',
            search: false,
            type: "date",
            hide: true,
            pickerOptions: {
                disabledDate(time) {
                    return time.getTime() > Date.now();
                },
                shortcuts: [{
                    text: '今天',
                    onClick(picker) {
                        picker.$emit('pick', new Date());
                    }
                }]
            },
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
        }, {
            label: '指定结束时间',
            prop: 'scheduleTimeEnd',
            search: false,
            type: "date",
            hide: true,
            pickerOptions: {
                disabledDate(time) {
                    return time.getTime() > Date.now();
                },
                shortcuts: [{
                    text: '今天',
                    onClick(picker) {
                        picker.$emit('pick', new Date());
                    }
                }]
            },
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
        },

    ]
}